using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;

namespace MediaController.Configuration
{
    [Serializable]
    [XmlType("WatchConfiguration")]
    public class WatchConfiguration : Configuration<WatchConfiguration>, IListSource
    {
        [XmlArray("Folders")]
        [XmlArrayItem("Folders")]
        public List<FolderConfiguration> Folders { get; set; }

        public bool RenameExtractedFileToFolderName { get; set; }
        
        //[XmlArray("FoldersConfiguration")]
        //[XmlArrayItem("FoldersConfiguration")]
        //public BindingList<FolderConfiguration> FoldersConfiguration { get; set; }

        #region IListSource Members

        public bool ContainsListCollection
        {
            get { return true; }
        }

        public System.Collections.IList GetList()
        {
            return Folders;
        }

        #endregion
    }

    [XmlRoot("FolderConfiguration")]
    [XmlType("FolderConfiguration")]
    [Serializable]
    public class FolderConfiguration
    {
        public bool Enabled { get; set; }

        public string Path { get; set; }

        public bool SearchInSubDirectories { get; set; }

    }

}